]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
app: Don't rely on app menu to check for GtkApplications
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 4 Oct 2018 17:11:05 +0000 (19:11 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 6 Feb 2019 17:29:15 +0000 (18:29 +0100)
As the app menu is being phased out, it is no longer a good indicator
for GtkApplications. Instead, base the check directly on the appropriate
D-Bus properties.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624

src/shell-app.c

index 108bb4d116d0e573d49d678c68a68c1d8f773876..c765800dc300b26d3fd6f8bf611a174e5cf96ce4 100644 (file)
@@ -602,6 +602,7 @@ gboolean
 shell_app_can_open_new_window (ShellApp *app)
 {
   ShellAppRunningState *state;
+  MetaWindow *window;
 
   /* Apps that are not running can always open new windows, because
      activating them would open the first one */
@@ -635,11 +636,13 @@ shell_app_can_open_new_window (ShellApp *app)
      Activate() knows nothing about the other instances, so it will show a
      new window.
   */
-  if (state->remote_menu)
+
+  window = state->windows->data;
+
+  if (state->unique_bus_name != NULL &&
+      meta_window_get_gtk_application_object_path (window) != NULL)
     {
-      const char *application_id;
-      application_id = meta_window_get_gtk_application_id (state->windows->data);
-      if (application_id != NULL)
+      if (meta_window_get_gtk_application_id (window) != NULL)
         return FALSE;
       else
         return TRUE;